<template>
	<view>
		<each></each>
		<view class="banner">
			<swiper class="swiper" circular :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval"
				:duration="duration">
				<swiper-item  v-for="item in bannere">
					<navigator :url="'/subpkg/goods/goods?id='+item.goods_id" style="width:100%;height:100%">
						<image :src="item.image_src" style="width: 100%;height: 100%;" ></image>
					</navigator >
				</swiper-item>
			</swiper>
		</view>
		<view class="tup">
			<navigator :url="item.open_type == switchTab ? '/subpkg/Lista/Lista?id='+item.navigator_url : '/pages/cate/cate' " :open-type="item.open_type == switchTab ? 'navigateTo' :  'switchTab' " v-for="item in datoh">
				<image  style="width: 100%;height: 100%;" :src="item.image_src" mode=""></image>
			</navigator>
		</view>
		<view class="const" v-for="itema in cosntsa">
			<view><image style="height: 100%;" :src="itema.floor_title.image_src"></image></view>
			<view class="const-img">
				<view  v-for="iem in itema.product_list">
					<navigator style="width:100%;height:100%" :url="'/subpkg/Lista/Lista?name='+iem.navigator_url" >
						<image :src="iem.image_src" style="height: 100%;width:100%" mode=""></image>
					</navigator>
				</view>

			</view>
		</view>
	</view>
</template>



<script>
	import each from '../../components/each/each.vue';
	components:{
	    each
	}
	export default {
		data() {
			return {
				indicatorDots: true,
				autoplay: true,
				interval: 2000,
				duration: 500,
				bannere:[],
				datoh:[],
				cosntsa:[]
			}
		},
		onLoad() {
			this.banner();
			this.daohe();
			this.cosntsf()
		},
		methods: {
			banner(){
				uni.request({
				    url: 'https://www.uinav.com/api/public/v1/home/swiperdata', //仅为示例，并非真实接口地址。
				    data: {
				        text: 'uni.request'
				    },
				    success: (res) => {
						this.bannere = res.data.message
				    }
				});
			},
			daohe(){
				uni.request({
				    url: 'https://www.uinav.com/api/public/v1/home/catitems', //仅为示例，并非真实接口地址。
				    data: {
				        text: 'uni.request'
				    },
				    success: (res) => {
						this.datoh = res.data.message
				    }
				});
			},
			cosntsf(){
				uni.request({
				    url: 'https://www.uinav.com/api/public/v1/home/floordata', //仅为示例，并非真实接口地址。
				    data: {
				        text: 'uni.request'
				    },
				    success: (res) => {
						this.cosntsa = res.data.message;
						this.cosntsa.forEach(elemen=>{
							elemen.product_list.forEach(el=>{
								el.navigator_url = el.navigator_url.split('=')[1]
							})
						})
						
				    }
				});
			}
		}
	}
</script>

<style lang="scss">
.buootm{
	height:90rpx;
	background-color: #ff0000;
	>button{
		text-align: center;
		height:80rpx;
		line-height: 80rpx;
	}
}
.banner{
	height:300rpx;
}
.tup{
	display: flex;
	height:180rpx;
	margin-top: 50rpx;
}
.tup>navigator{
	flex:1;
	height:100%;
}
.uni-margin-wrap {
	width: 690rpx;
	width: 100%;
}
.swiper {
	height: 300rpx;
}
.swiper-item {
	display: block;
	height: 300rpx;
	line-height: 300rpx;
	text-align: center;
}
.swiper-list {
	margin-top: 40rpx;
	margin-bottom: 0;
}
.uni-common-mt {
	margin-top: 60rpx;
	position: relative;
}
.info {
	position: absolute;
	right: 20rpx;
}
.uni-padding-wrap {
	width: 550rpx;
	padding: 0 100rpx;
}
.const{
	height:550rpx;
	margin-top: 50rpx;
	>view:nth-child(1){
		height:100rpx;
	}
	>view{
		height:450rpx;
	}
}
.const-img{
	height: 100%;
	>view{
		float: left;
		height:50%;
		width:30%;
		margin:10rpx;
	}
	>view:nth-child(1){
		float: left;
		height:103%;
		width:30.33%;
		
	}
}
</style>
